package com.hao1st.consumer.biz.mqdemo.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.function.Consumer;

@Slf4j
@Configuration
public class DemoConsumer {

    public static class Person {
        private String name;
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String toString() {
            return this.name;
        }
    }

    @Bean
    public Consumer<Person> mq() {
        return person -> {
            log.info("Received: {}", person);
        };
    }
}
